package cn.cutie.clotcache.core;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description:
 * @Author: Cutie
 * @CreateDate: 2024/6/19 20:08
 * @Version: 0.0.1
 */
public enum ReplyType {
    INT,ERROR,SIMPLE_STRING,BULK_STRING,ARRAY;

    public static ReplyType getType(String type)
    {
        switch (type)
        {
            case "+":
                return SIMPLE_STRING;
            case "-":
                return ERROR;
            case ":":
                return INT;
            case "$":
                return BULK_STRING;
            case "*":
                return ARRAY;
            default:
                return null;
        }
    }
}
